
import platform


if platform.system()[:5] == 'Linux':
    # system path
    QB_PATH = '/sw/systems/shared/python/qb'
    QB_GUI_PATH = '/sw/systems/shared/python/qb/gui/'
    QB_LOG_PATH = '/sw/BFX/qubelog/job/'

    # custom path
    FAILED_JOBS = '/job/HOME/share/guochen/qube_log/Failed'
    STUCK_HOSTS = '/job/HOME/share/guochen/qube_log/stuckHost'
    BLOCK_LOG_PATH = '/job/HOME/share/guochen/qube_log/blockList'
    ERROR_MESSAGE = '/job/HOME/share/guochen/qube_log/ErrorMessage'

elif platform.system()[:3] == 'win':
    QB_PATH = 'S:/systems/shared/python/qb'
    QB_GUI_PATH = 'S:/systems/shared/python/qb/gui/'
    QB_LOG_PATH = 'S:/BFX/qubelog/job/'

    # custom path
    FAILED_JOBS = 'X:/share/guochen/qube_log/Failed'
    STUCK_HOSTS = 'X:/share/guochen/qube_log/stuckHost'
    BLOCK_LOG_PATH = 'X:/share/guochen/qube_log/blockList'
    ERROR_MESSAGE = 'X:/share/guochen/qube_log/ErrorMessage'

# copy from Qube
QUBE_TIME = 946702800

qb_jobStatus_id = {
    'none': 0,
    'saved': 5,
    'complete': 16,
    'warning': 21,
    'failed': 32,
    'killed': 48,
    'dying': 261,
    'exiting': 262,
    'registering': 265,
    'blocked': 272,
    'paused': 293,
    'suspended': 304,
    'pending': 320,
    'waiting': 323,
    'badlogin': 325,
    'running': 336,
}
qb_jobStatus_str = {
    0: 'none',
    5: 'saved',
    16: 'complete',
    21: 'warning',
    32: 'failed',
    48: 'killed',
    261: 'dying',
    262: 'exiting',
    265: 'registering',
    272: 'blocked',
    288: 'waiting',
    293: 'paused',
    304: 'suspended',
    320: 'pending',
    323: 'waiting',
    325: 'badlogin',
    336: 'running',
}

qb_hostState_id = {
    'none': 0,
    'active': 1,
    'panic': 2,
    'down': 257,
}
qb_hostState_str = {
    0: 'none',
    1: 'active',
    2: 'panic',
    257: 'down',
}

qb_tallyOrder_id = {
    'running': 1,
    'blocked': 2,
    'complete': 3,
    'pending': 4,
    'suspended': 5,
    'failed': 6,
    'killed': 7,
    'waiting': 8,
    'unknown': 9,
    'warning': 10,
    'badlogin': 11,
}

qb_tallyOrder_str = {
    1: 'running',
    2: 'blocked',
    3: 'complete',
    4: 'pending',
    5: 'suspended',
    6: 'failed',
}


user = 'chenqx'
password = '587hh*12'
